<?php

/**
 * LEAGUEMan
 * 
 * Copyright (C) 2007 Marko Bischof
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

?>

<div class="contentheading">
	<?php echo $this->project->getName(); ?>
</div>

<table class="contentpane">
	<tr>
		<td width="45%">
			<div align="right">
				<h2><?php echo $this->team1->getName();?></h2>
			</div>
		</td>
		<td width="10%">
			<div align="center"><b>vs.</b></div>
		</td>
		<td width="45%">
			<div align="left">
				<h2><?php echo $this->team2->getName();?></h2>
			</div>
		</td>
	</tr>
	<tr>
		<td width="45%">
			<div align="right">
				<span class="contentheading"><b><?php echo $this->match->match_result_0_1;?></b></span>
			</div>
		</td>
		<td width="10%"><div align="center">:</div></td>
		<td width="45%">
			<div align="left">
				<span class="contentheading"><b><?php echo $this->match->match_result_0_2;?></b></span>
			</div>
		</td>
	</tr>
</table>

<table class="contentpane" style="border:1px solid #DDD">
	<tr>
		<td colspan="3" class="sectiontableheader">Aufstellung</td>
	</tr>
	<tr>
		<td width="45%" valign="top">
			<?php $players = $this->match->getLineupData($this->team1);?>
			<?php $ps = array(); ?>
			<?php foreach($players AS $player):?>
			<?php 	$link = sefRelToAbs("index.php?option=com_leagueman&amp;func=playerinfo&amp;pid={$player->player_id}&amp;Itemid={$this->Itemid}");?>
			<?php 	$ps[] = "<a href=\"$link\">" . $player->player_name . "</a>"; ?>
			<?php endforeach ?>
				
			<span style="font-size:smaller;"><?php echo implode(", ", $ps);?></span>
		</td>
		<td width="10%"></td>
		<td width="45%" valign="top">
			<?php $players = $this->match->getLineupData($this->team2);?>
			<?php $ps = array(); ?>
			<?php foreach($players AS $player):?>
			<?php 	$link = sefRelToAbs("index.php?option=com_leagueman&amp;func=playerinfo&amp;pid={$player->player_id}&amp;Itemid={$this->Itemid}");?>
			<?php 	$ps[] = "<a href=\"$link\">" . $player->player_name . "</a>"; ?>
			<?php endforeach ?>
				
			<span style="font-size:smaller;"><?php echo implode(", ", $ps);?></span>
		</td>
	</tr>
</table>

<?php include $this->loadTemplate($this->project->getTemplate() . "/matchinfo.tpl.php"); ?>